package ar.com.gep.soccer.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import ar.com.gep.soccer.exception.SeasonBusinessException;
import ar.com.gep.soccer.facade.TournamentFacade;
import ar.com.gep.soccer.services.SeasonService;
import ar.com.gep.soccer.services.dto.SeasonDTO;
import ar.com.gep.soccer.services.dto.WeekInfoSeasonDTO;

@Service
public class SeasonServiceImpl implements SeasonService {

	@Autowired
	TournamentFacade facade;

	@Override
	public SeasonDTO getById(final Long id) throws SeasonBusinessException {
		return facade.getSeasonById(id);
	}

	@Override
	public SeasonDTO save(SeasonDTO seasonDTO) throws SeasonBusinessException {
		return facade.saveSeason(seasonDTO);
	}

	@Override
	public SeasonDTO update(SeasonDTO seasonDTO) throws SeasonBusinessException {
		return facade.updateSeason(seasonDTO);
	}

	@Override
	public SeasonDTO playWeek(final Long id) throws SeasonBusinessException {
		return facade.playSeasonWeek(id);
	}

	@Override
	public WeekInfoSeasonDTO getWeekInfo(final Long id, final Integer week) throws SeasonBusinessException {
		return facade.getWeekInfo(id, week);
	}
	
	

}
